#!/bin/bash

# Detect document path
if [ -z "$1" ] ; then
	PATHDOCUMENT=`pwd`
else
	PATHDOCUMENT=$1
fi

# Detect listen port, just for display
PORT=`grep Listen __PHP5_PATHINSTALL__/etc/apache.conf | cut -f 2 -d ' '`

echo "Start apache"
echo "Listen $PORT"
echo "DocumentRoot $PATHDOCUMENT"

apache2 -f __PHP5_PATHINSTALL__/etc/apache.conf -C "DocumentRoot $PATHDOCUMENT" -DFOREGROUND -DNO_DETACH 
